function layout(value) {
	if (value) {
		var index = value.lastIndexOf(".");
		var img_id = value.substring(index);
		if (img_id == ".bmp" || img_id == ".png" || img_id == ".gif" || img_id == ".jpg" || img_id == ".jpeg") {
			return "图片"
		} else {
			if (img_id == ".mp4" || img_id == ".rmvb" || img_id == ".avi" || img_id == ".ts" || img_id == ".mov" ||
				img_id == ".hevc") {
				return "视频"
			}
		}
	}
}

function process_Pictures(array) {
	var imgs = JSON.parse(array)
	if (imgs.length == 0) return array
	var brr = []
	imgs.forEach(item=>{
		if (item.message != '上传中') {
			brr.push(item)
		}
		
	}) 
	return JSON.stringify(brr)
}
function shijianc(time) {
	var date = new Date(time)
	var Y = date.getFullYear() + '/'
	var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '/'
	var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
	var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
	var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
	var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds())
	return Y + M + D + h + m + s

}
export default {
	layout,
	shijianc,
	process_Pictures
}
